﻿using System;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;


namespace Gp.Scripts.Core {
    [Serializable]
    public class OptionInfo {
        [PreviewField]
        [LabelText("选项图标")]
        public Sprite icon;
        [LabelText("选项名")]
        public string text;
    }
    
    public struct OptionItem {
        public OptionInfo Info;
        public Action OnSelect;
        public OptionItem(OptionInfo info, Action onSelect) {
            Info = info;
            OnSelect = onSelect;
        }
    }
    
    /// <summary>
    /// Class represents a game participant.
    /// </summary>
    public abstract class BattlePlayer {
        public int PlayerNumber;


        public virtual void Init() { }

        public abstract void Play();


        public virtual void ContinuePlay(Ability ability = null) {}

        public virtual IEnumerator ResolveReaction<T>(List<BaseReactionEntity> wrappers, T args) where T : ReactionArgs {
            yield break;
        }

        public virtual IEnumerator ResolveOption(SkillEntity skill, IEnumerable<OptionItem> args) {
            yield break;
        }
    }
}